if practice
  span.text-uppercase.small-details.spr(data-i18n='teacher.practice')

mixin timePlayed()
  if session.playtime > 0
    .small-details.nowrap 
      span(data-i18n="teacher.time_played_label")
      =" "
      span.spr(data-i18n='teacher.time_played')
      span= moment.duration({ seconds: session.playtime }).humanize()
    
mixin header()
  strong.small-details.nowrap
    if assessment
      if assessment === 'cumulative'
        span(data-i18n="play_level.combo_challenge")
      else
        span(data-i18n="play_level.concept_challenge")
      =": "
    else
      span(data-i18n="teacher.level_label")
      =" "
      if levelNumber
        span= levelNumber
        span.spr . 
    span= levelName
    
mixin assessmentLines()
  if (assessment === 'open-ended' || assessment === 'cumulative')
    .small-details.nowrap
      span(data-i18n="teacher.concepts_used")
    if conceptGoals
      for goal in conceptGoals
        .small-details
          if goalStates && goalStates[goal.id] && goalStates[goal.id].status === 'success'
            i.glyphicon.glyphicon-ok
          else
            i.glyphicon.glyphicon-remove
          =" "
          span(data-i18n="concepts." + goal.concepts[0])
  else
    .small-details.nowrap
      span(data-i18n="teacher.concept_checked")
    em.small-details
      span(data-i18n="concepts." + primaryConcept)

if completed
  +header
  if topScore
    br
    strong.small-details
      - translatedScoreType = translate("leaderboard."+_.string.underscored(topScore.type))
      - translation = translate("leaderboard.score_display", { score: topScore.score.toFixed(0), scoreType: translatedScoreType })
      span(data-i18n='teacher.success')
      if topScore.thresholdAchieved
        img.threshold-icon(src="/images/pages/courses/star-" + topScore.thresholdAchieved + ".png")
      =" "
      span (#{translation})
  .small-details.nowrap
    span(data-i18n='teacher.completed')
    =": "
    - var dateCompleted = session.dateFirstCompleted || session.created || session.changed;
    if dateCompleted
      span= moment(dateCompleted).format('lll')
    +timePlayed
  if assessment
    +assessmentLines
  if !isProject && !isLadder
    .small-details.nowrap.m-t-1
      .student-code(data-i18n="teacher.view_student_code")
else if started
  +header
  .small-details.nowrap
    span(data-i18n='user.last_played')
    =": "
    span= moment(session.changed).format('lll')
    +timePlayed
  if assessment
    +assessmentLines
        
  if !isProject && !isLadder
    .small-details.nowrap.m-t-1
      .student-code(data-i18n="teacher.view_student_code")
else
  +header
  if practice
    .small-details.nowrap(data-i18n='teacher.not_required')
  else
    .small-details.nowrap(data-i18n='teacher.no_progress')
    if locked
      .small-details.nowrap
        span  (
        span(data-i18n='play.locked')
        span )
